package com.xr.miniprogram.controller.pay;

import com.xr.common.annotation.Log;
import com.xr.common.core.controller.BaseController;
import com.xr.common.core.domain.AjaxResult;
import com.xr.miniprogram.service.IMiniProgramOrderStatusService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;

/**
 * description: 订单状态
 *
 * @author: wls
 * @date: 2023/9/1 14:53
 * @version:1.0
 */
@Api("订单状态控制")
@RestController
@RequestMapping("/miniprogram/orderStatus")
public class MiniProgramOrderStatusController extends BaseController {
    @Autowired
    private IMiniProgramOrderStatusService miniProgramOrderStatusService;


    /**
     * 获取订单状态信息
     */
    @ApiOperation("根据id获取订单状态")
    @GetMapping(value = "/get")
    public AjaxResult getInfo(@ApiParam(value = "订单状态id", required = true) @RequestParam("orderStatusId") Long orderStatusId)
    {
        return success(miniProgramOrderStatusService.selectById(orderStatusId));
    }

    /**
     * 获取订单标签统计
     */
    @ApiOperation("获取订单状态标签菜单")
    @GetMapping(value = "/typeList")
    public AjaxResult getTypeCount()
    {
        return success(miniProgramOrderStatusService.getTypeList());
    }

}
